﻿using System;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;

namespace RemoteClient
{
    class MyClient
    {
        [STAThread]
        static void Main(string[] args)
        {
            //TcpChannel channel = new TcpChannel();
            //ChannelServices.RegisterChannel(channel);
            IRemoteObject app =
                (IRemoteObject)
                Activator.GetObject(typeof(IRemoteObject), "tcp://localhost:8989/RemoteObject.RemotingObject");
            Console.Write(app.GetPersonInfo("12", "23", 34).Name);
            //Console.ReadLine();
            string url = "http://remote.com/Remote.soap";
            //string url = System.Configuration.ConfigurationSettings.AppSettings["url"];
            IRemoteOpration app1 = (IRemoteOpration)Activator.GetObject(typeof(IRemoteOpration), url);
            Console.Write(url);
            Console.Write(app1.Add(4, 5).ToString());
            Console.ReadLine();
        }
    }
}
